public class Solution {
    public static void main(String[] args) {
	Solution s = new Solution();
    	System.out.println(s.countAndSay(Integer.parseInt(args[0])));

    }
    public String countAndSay(int n) {
        if (n == 1)
            return new String(Integer.toString(1));
        
        StringBuffer last = new StringBuffer(Integer.toString(1));
        StringBuffer next = new StringBuffer();
        int i = 2;
        for (; i <= n; ++i) {
            int j = 0;
            while (j < last.length()) {
                int k = j;
                while (k < last.length() && last.charAt(k) == last.charAt(j))
                    k++;

                next.append(Integer.toString(k-j) + last.charAt(j));
                j = k;
            }
            last.setLength(0);
            StringBuffer temp = last;
            last = next;
            next = temp;
	    System.out.println(last);
        }
        
        return last.toString();
    }
}
